<?php
class News_ComponentController extends XPHP_Controller
{
    public function lastestAction()
    {
        $modelNews = new Areas_News_Models_News();
        $newsList = $modelNews->getLastestNews(4);
        //Lay ra danh sach cac danh muc cua tin tuc
        foreach($newsList as $k => $n)
        {
            $modelNC = new Areas_News_Models_NewsCategory($n->category_id);
            $newsList[$k]->category_name = $modelNC->name;
        }
        $this->view->newsList = $newsList;
        return $this->view();
    }
}